This document describes how to build a calibration jig that illuminates a Raspberry Pi camera module with uniform-intensity, approximately-collimated light. Used in conjunction with a suitable RGB LED, it enables the sensor to be calibrated for colour response, allowing the vignetting and loss of saturation at the edge of the sensor to be compensated for in post-processing. It can also be used to calculate a suitable Lens Shading Table under some circumstances.
Bill of materials
- 1 x Raspberry Pi camera module
- 2 x M2x6mm screws
- 10 x M3x8mm screws
- 2 x 30mm O-rings
- 1 x white paper
- 1 x NeoPixel
- 3 x wires with female jumper connectors
- a little solder
- 1 x Arduino Mega
- 1 x Raspberry Pi
- 1 x 5V micro-USB power supply
- 1 x SD card
- 1 x keyboard, monitor, and mouse
Step 1: Remove the lens from the camera module
First, remove the lens from the Raspberry Pi camera module. This is described in the OpenFlexure Microscope assembly instructions, but just consists of using the plastic lens tool (included with v2 of the camera module) to unscrew the lens. Be gentle, and take care not to damage the small ribbon cable connecting the sensor to the PCB.
Step 2: Fit the camera module into the mount
Step 3: Add screws to the tube
Step 4: Fit the camera mount into the tube
Place the camera mount into the long tube, and secure using two 30mm O-rings, one either side. The 30mm O-rings are wrapped around the M3x8mm screws and the protruding parts of the camera mount. Each O-ring is wrapped around twice, to ensure the mount is held tightly.
Step 5: Add the paper diffuser
Step 6: Add the LED
Solder wires with female jumper connectors to the data and power pads on the NeoPixel. Clamp the NeoPixel onto the LED mount using the LED clamp and two M3x8mm screws, using a 2.5mm hex key. You will probably need a soldering iron, solder, and wire strippers
Step 7: Connect to electronics
Connect the NeoPixel to the Arduino Mega, wiring the 5V and 0V lines to ground and power on the Arduino, and the data line to digital pin 6. Connect the Raspberry Pi camera module to the Raspberry Pi. The arduino doesn't need a powers supply as it's powered via USB from the Raspberry Pi, and the Raspberry Pi will require an SD card, a 5V micro-USB power supply, and a keyboard, monitor, and mouse or some other way of controlling it (e.g. a network cable).